<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>{{$store.state.list.length}}</strong></span>
    <ul class="filters">
      <li>
        <a :class="{selected:isShow==='all'}" @click=" change('all') " href="javascript:;" >全部</a>
      </li>
      <li>
        <a :class="{selected:isShow==='no'}" @click=" change('no')  " href="javascript:;">未完成</a>
      </li>
      <li>
        <a :class="{selected:isShow==='yes'}" @click=" change('yes') " href="javascript:;" >已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="$store.commit('clearFinsh')" >清除已完成</button>
  </footer>
</template>

<script>
import {mapMutations, mapState } from 'vuex'
export default {
  data () {
    return {
      // isShow:this.$store.state.isShow
    }
  },
  methods:{
    ...mapMutations(['changeIsShow']),
    change(str){
      this.changeIsShow(str)
    }
  },
  computed: {
    ...mapState(['isShow']),
  }
}
</script>
